import {instance} from "@/api/baseReq.js";


export const getAlerts = async (triName = null) => {
    const api = '/alertCenter/alertApi/getAlerts';
    const data = {
        flag: 0,
        start: 0,
        length: 10,
        orderNames: [],
        orderTypes: []
    };
    const res = await instance.post(api, data, {
        params: {triggerName: triName},
        headers: {
            'Content-Type': 'application/json'
        }
    })
    // console.log(res);
    const rst = res.data;
    if (rst.errCode === 0) {
        return rst.data.list;
    } else {
        await Promise.reject(rst.msg);
    }
}
